export default{
    methods: {
        createRouteFn(){
            let arrRoute = JSON.parse(localStorage.arrRoute);
            arrRoute.forEach((v) => {
                v.children.forEach((r) => {
                    this.$router.addRoute("index", {
                        path: r.path,
                        name: r.path,
                        meta: {
                            title: r.authName,
                            subTitle:r.authName,
                            // 除了商品列表，其他页面都会被保存状态
                            keepAlive:r.authName=='商品列表'?false:true
                        },
                        component: () =>
                            import(
                                `@/views/${
                                    r.path.substring(0, 1).toUpperCase() + r.path.substring(1)
                                }View.vue`
                            ),
                    });
                });
            });

        }
    },
}